<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="./template.xhtml">

      <ui:define name="head">
        <style type="text/css">
            .ui-button {
                margin-top: 10px
            }
        </style>
	</ui:define>

    <ui:define name="title">
        Horizontal Tree - <span class="subitem">Selection</span>
    </ui:define>

    <ui:define name="description">
        Tree provides three selection modes, "single", "multiple" and "checkbox".
    </ui:define>

    <ui:param name="documentationLink" value="/components/tree?id=horizontal-tree" />

    <ui:define name="implementation">

        <h:form>
            <p:growl id="msgs" showDetail="true" escape="false"/>
            
            <h3 style="margin-top:0">Single</h3>
            <p:tree value="#{treeSelectionView.root1}" var="doc" orientation="horizontal"
						selectionMode="single"
						selection="#{treeSelectionView.selectedNode}">
                <p:treeNode expandedIcon="pi pi-folder-open" collapsedIcon="pi pi-folder">
                    <h:outputText value="#{doc.name}"/>
                </p:treeNode>
                <p:treeNode type="document" icon="pi pi-file">
                    <h:outputText value="#{doc.name}" />
                </p:treeNode>
                <p:treeNode type="picture" icon="pi pi-image">
                    <h:outputText value="#{doc.name}" />
                </p:treeNode>
                <p:treeNode type="mp3" icon="pi pi-video">
                    <h:outputText value="#{doc.name}" />
                </p:treeNode>
            </p:tree>
				
            <p:commandButton value="Display" update="msgs" icon="pi pi-clone"
								action="#{treeSelectionView.displaySelectedSingle}"/>
            
            <h3>Multiple with metakey</h3>
            <p:tree value="#{treeSelectionView.root2}" var="doc" orientation="horizontal"
						selectionMode="multiple"
						selection="#{treeSelectionView.selectedNodes1}">
                <p:treeNode expandedIcon="pi pi-folder-open" collapsedIcon="pi pi-folder">
                    <h:outputText value="#{doc.name}"/>
                </p:treeNode>
                <p:treeNode type="document" icon="pi pi-file">
                    <h:outputText value="#{doc.name}" />
                </p:treeNode>
                <p:treeNode type="picture" icon="pi pi-image">
                    <h:outputText value="#{doc.name}" />
                </p:treeNode>
                <p:treeNode type="mp3" icon="pi pi-video">
                    <h:outputText value="#{doc.name}" />
                </p:treeNode>
            </p:tree>
				
            <p:commandButton value="Display" update="msgs" icon="pi pi-clone"
                        action="#{treeSelectionView.displaySelectedMultiple(treeSelectionView.selectedNodes1)}"/>
            
            <h3>Checkbox</h3>
            <p:tree value="#{treeSelectionView.root3}" var="doc" orientation="horizontal"
						selectionMode="checkbox"
						selection="#{treeSelectionView.selectedNodes2}">
                <p:treeNode icon="pi pi-paperclip">
                    <h:outputText value="#{doc.name}"/>
                </p:treeNode>
                <p:treeNode type="document" icon="pi pi-file">
                    <h:outputText value="#{doc.name}" />
                </p:treeNode>
                <p:treeNode type="picture" icon="pi pi-image">
                    <h:outputText value="#{doc.name}" />
                </p:treeNode>
                <p:treeNode type="mp3" icon="pi pi-video">
                    <h:outputText value="#{doc.name}" />
                </p:treeNode>
            </p:tree>
				
            <p:commandButton value="Display" update="msgs" icon="pi pi-clone"
                        action="#{treeSelectionView.displaySelectedMultiple(treeSelectionView.selectedNodes2)}"/>
        </h:form>
        
    </ui:define>

</ui:composition>